<?php
class adminBase extends Activity {
    /** @var CmsView  */
    protected $cms;
    /** @var  UserModule */
    protected $user;
    function __construct() {
        $this->user=AdminModule::init("admin");
        if(!$this->user->checkLogin()){
            header("Location:".WebRouter::init()->getPage("home","index"));
            exit();
        }
        $userInfo=$this->user->getLoginInfo();
        $this->cms=CmsView::init(null, null, array(
            "navFile"=>"admin/nav.json",
            "userInfoFile"=>"admin/userinfo.json",
            "controlFile"=>"",
        ));
        $this->cms->loadConfig(array("navFile"=>"admin/super_nav.json"));
        $this->cms->setUserName($userInfo['email']);
    }
}
